<?php
declare (strict_types=1);

namespace app\organization\controller\core;

use app\common\controller\Frontend;
use app\common\enums\AccountTypeEnum;
use app\common\model\banxi\core\CoreAccountData as CoreAccountDataModel;
use think\db\exception\DbException;

class CoreAccountData extends Frontend
{
    protected array $noNeedLogin = [];
    protected array $noNeedPermission = [];

    public function initialize(): void
    {
        parent::initialize();
        $this->model = new CoreAccountDataModel();
    }


    /**
     * 分页查询
     * @return void
     * @throws DbException
     */
    public function getMyAccountData(): void
    {
        $info = $this->model->where([
            'accountId' => $this->auth->organizationId,
            'accountType' => AccountTypeEnum::ORGAN
        ])->find() ?? ['brokerageAmount' => 0];
        $this->ok('操作成功', removeNull($info));
    }
}
